#pragma once

#include <map>
#include <vector>
#include "HashedString.h"
#include "Pointer.h"
#include "IResource.h"

class Avatar : public IResource
{
public:
	class Data
	{
	public:
		typedef std::vector<Pointer<Data>> Vector_t;
		typedef HashedString AttributeName_t;
		typedef HashedString AttributeData_t;
		typedef std::map<AttributeName_t, AttributeData_t> AttributeMap_t;
		typedef std::pair<AttributeName_t, AttributeData_t> AttributePair_t;

		HashedString& getName();
		AttributeMap_t& getValues();
		Vector_t& getChildren();
	private:
		HashedString m_name;
		AttributeMap_t m_values;
		Vector_t m_children;
	};

	static const HashedString type;
	const HashedString& getResourceType() const;
	
	Data::Vector_t& getComponents();
	bool FromXML( tinyxml2::XMLElement* element );
	bool ToXML( tinyxml2::XMLPrinter &printer );
	
protected:
	bool FromXML( tinyxml2::XMLElement* element, Data::Vector_t& dataArray );
	bool ToXML( tinyxml2::XMLPrinter &printer, Data::Vector_t& dataArray );

	Data::Vector_t m_components;
};